
\documentclass{ctexart}

% Language setting
% Replace `english' with e.g. `spanish' to change the document language
\usepackage[english]{babel}

% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}

% Useful packages
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amsfonts, amssymb}
\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\title{科学计算导论——MATLAB解决的十二个计算项目}
\author{Ionut Danaila}

\begin{document}
\maketitle

%\begin{abstract}
%Your abstract.
%\end{abstract}

\section{流体动力学：求解二维Navier-Stokes方程}

%Your introduction goes here! Simply start writing your document and use the Recompile button to view the updated PDF preview. Examples of commonly used commands and features are listed below, to help you get started.

%Once you're familiar with the editor, you can find various project settings in the Overleaf menu, accessed via the button in the very top left of the editor. To view tutorials, user guides, and further documentation, please visit our \href{https://www.overleaf.com/learn}{help library}, or head to our plans page to \href{https://www.overleaf.com/user/subscription/plans}{choose your plan}.


\subsection{不可压流体的Navier-Stokes方程}

不可压缩流体的二维流场可以由速度矢量$q = (u(x, y), v(x, y))\in \mathbb{R}^2$
    和压力$p(x, y)\in \mathbb{R}$完整地刻画.\cite{ly} 这些函数是下列守恒定律的解（例如，Hirsch，1988）：\\
    \textbullet 质量守恒：
    \begin{equation}\label{eq:12.1}
        div(q)=0
    \end{equation}
    或者，使用\textit{散度算子}\footnote{这里回忆二维场中的微分算子\textit{散度，梯度和拉普拉斯算子}的定义：若$v=(v_{x}, v_{y}):\mathbb{R}^2 \mapsto \mathbb{R}^2$且$\varphi :\mathbb{R}^2 \mapsto \mathbb{R}$，则\\$div(v)=\frac{\partial v_x}{\partial x}+\frac{\partial v_y}{\partial y}$, $\mathcal{G} \varphi = (\frac{\partial \varphi}{\partial x},\frac{\partial \varphi}{\partial y})$, $\Delta \varphi = div(\mathcal{G} \varphi) = \frac{\partial ^2 \varphi}{\partial x^2} + \frac{\partial ^2 \varphi}{\partial y^2}$,且$\Delta v = (\Delta v_x, \Delta v_y)$.}的显式形式书写，
    \begin{equation}\label{eq:12.2}
        \frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}=0 
    \end{equation}
    \textbullet 紧致形式的动量守恒方程\footnote{我们用$\otimes$表示张量积}
    \begin{equation}\label{eq:12.3}
        \frac{\partial q}{\partial t}+div(q\otimes q)=-\mathcal{G}p+\frac{1}{Re} \Delta q
    \end{equation}
    或者将其写成解析形式，
    \begin{equation}\label{eq:12.4}
        \begin{cases}
            \frac{\partial u}{\partial t} + \frac{\partial u^2}{\partial x} + \frac{\partial uv}{\partial y} = -\frac{\partial p}{\partial x} + \frac{1}{Re}(\frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial y^2}),\\
             \frac{\partial v}{\partial t} + \frac{\partial uv}{\partial x} + \frac{\partial v^2}{\partial y} = -\frac{\partial p}{\partial y} + \frac{1}{Re}(\frac{\partial^2v}{\partial x^2} + \frac{\partial^2v}{\partial y^2}).
        \end{cases}
    \end{equation}
    \qquad 前面的方程采用\textit{无量纲}形式，使用以下比例变量：
    \begin{equation}\label{eq:12.5}
        x=\frac{x^*}{L}, y=\frac{y^*}{L}, u=\frac{u^*}{V_0}, v=\frac{v^*}{V_0}, t=\frac{t^*}{L/V_0}, p=\frac{p^*}{\rho_0 V_0^2},
    \end{equation}
    其中上标（*）表示以物理单位测量的变量。常数$L, V_0$分别是表征模拟流动的参考长度和速度. 无量纲数$Re$称为雷诺数，量化了惯性（或对流）项和粘性（或扩散）\footnote{对描述对流和扩散现象的模型标量方程的讨论见第一章}项在流动中的相对重要性：
    \begin{equation}\label{eq:12.6}
        Re=\frac{V_0L}{\upsilon},
    \end{equation}
    其中，$\upsilon$是流体的运动粘度.\\
    \qquad 总之，将在本项目中数值求解的偏微分方程的Navier-Stokes系统由(\ref{eq:12.2})和(\ref{eq:12.4})定义；初始条件（在$t=0$处）和边界条件将在以下部分中讨论.

\subsection{计算域、交错网格和边界条件}

通过考虑处处具有周期性边界条件的矩形域 $L_{x} \times  L_{y}$（见图\ref{fig:12.1}），Navier-Stokes方程的数值求解大大简化. 速度 $q(x, y)$ 和压力 $p(x, y)$ 场的周期性在数学上表示为
\begin{align}
    q(0,y)=q(L_{x},y),p(0,y)=p( L_{x},y),\forall y\in  [ 0 ,L_{y} ]\\
    q(x,0)=q(x,L_{y}),p(x,0)=p(x,L_{y}),\forall x\in  [ 0 ,L_{x} ]
\end{align}
\qquad 计算解的点分布在矩形且均匀的二维网格域中. 由于在我们的方法中并非所有变量都共享相同的网格，因此我们首先定义一个主网格（见图\ref{fig:12.1}），该网格是通过沿$x$取$n_{x}$个计算点以及沿$y$取$n_{y}$点生成的：
\begin{align}
    x_{c}(i)=(i-1)\delta x,\delta x=\frac{L_{x}}{n_{x}-1},i=1,...,n_{x},\\
    y_{c}(j)=(j-1)\delta y,\delta y=\frac{L_{y}}{n_{y}-1},j=1,...,n_{y}, 
\end{align}
\begin{figure}
    \centering
    \begin{tikzpicture}
        \draw (-7,0) rectangle (-0.1,5);
        \draw (0.1,0) rectangle (7, 5);

        \draw (-5.55, 0.5) -- node [left] {Y} (-5.55, 4.7);
        \draw (-5.55, 0.5) -- node [below] {X} (-0.5, 0.5);
        \draw[red, thick] (-5.5, 0.5) rectangle (-1.5, 4.5);
        \draw[<->] (-3.5,0.5) -- node [right] {Periodicity} (-3.5, 1.5);
        \draw[<->] (-2.5,3.5) -- node [left] {Periodicity} (-2.5, 4.5);
        \draw[<->] (-5.5, 1.5) -- node [above] {Periodicity} (-4.5, 1.5);
        \draw[<->] (-2, 3) -- node [below] {Periodicity} (-1, 3);
        \node (A) at (-5.5, 0.5) {0};
        \node (B) at (-5.5, 4.8) {$L_y$};
        \node (C) at (-0.6, 0.3) {$L_x$};

        \coordinate (S) at (0.5, 1);
        \draw (5, 1) -- node [below] {X} (S);
        \draw (0.5, 4.5) -- node [left] {Y} (S);
        \draw[green] (3.5, 4) -- (3.5, 4 -| S);
        \draw[green] (3.5, 3) -- (3.5, 3 -| S);
        \draw[green] (3.5, 2) -- (3.5, 2 -| S);
        \draw[green] (3.5, 4) -- (3.5, 4 |- S);
        \draw[green] (2.5, 4) -- (2.5, 4 |- S);
        \draw[green] (1.5, 4) -- (1.5, 4 |- S);
        \node (D) at (S) {0};
        \node (E) at (1, 4.5) {$L_y$};
        \node (F) at (5, 0.8) {$L_x$};
        \draw[dashed] (0.5,2.5) -- (3.5,2.5);
        \draw[dashed] (2,1) -- (2,4);
        \coordinate (G) at (1.5, 2.5);
        \fill (G) circle[radius=2pt];
        \node[anchor = north] at (G) {u(i,j)};
        \coordinate (H) at (2, 2.5);
        \fill (H) circle[radius=2pt];
        \node[anchor = south] at (H) {p(i,j)};
        \coordinate (I) at (2, 2);
        \fill (I) circle[radius=2pt];
        \node[anchor = west] at (I) {v(i,j)};

    \end{tikzpicture}
    \caption{计算域、交错网格和边界条件.}
    \label{fig:12.1}
\end{figure}
\qquad 一个\textit{次要}格线由主要格线单元的中心定义：
\begin{align}
    x_{m}(i)=(i-1/2 )\delta x,i=1,...,n_{xm},\\
    y_{m}(j)=(j-1/2 )\delta y,j=1,...,n_{ym},
\end{align}
其中我们使用简写符号 $n_{xm} = n_{x}−1, n_{ym} = n_{y}−1$. 在定义为矩形 $[ x_{c}(i),x_{c}(i+1)]  \times [ y_{c}(j),y_{c}(j+1)]$ 的计算单元内，未知变量$u,v,p$将被计算为不同空间位置解的近似：
\begin{align}
    \textbullet u(i,j)\approx u(x_{c}(i),y_{m}(j))\qquad(\mbox{网格西面})\\
    \textbullet v(i,j)\approx u(x_{m}(i),y_{c}(j))\qquad(\mbox{网格南面})\\
    \textbullet p(i,j)\approx u(x_{m}(i),y_{m}(j))\qquad(\mbox{网格中心})
\end{align}
这种变量的\textit{交错}排列具有压力和速度之间强耦合的优点. 它还有助于（参见本章末尾的参考资料）避免并置排列（所有变量在同一网格点计算）所遇到的一些稳定性和收敛问题.

\bibliographystyle{plain}
\bibliography{references.bib}

\end{document}